Make plots
perm <- c(1,2,3,4,5,10,6,7,8,9,11)
tight <- read.csv("collman14v2_F0_tight_annotations.csv")[perm]
stight <- scale(tight, center = TRUE, scale = TRUE)
ccol <- c('blue', 'blue', 'blue', 'red', 'red',
'red', 'red', 'darkgreen', 'darkgreen', 'darkgreen',
'darkgreen')
set.seed(317)
Lt <- runAll(sF0, ccol = ccol)
Lt[[1]] <- mlocation(F0, ccol = ccol)
w = 720
h = 720
png("meda_plots_tight/d1heat.png", width = w, height = h)
p1 <- plot(Lc[[2]])
show(p1)
dev.off()
png("meda_plots_tight/mlocation.png", width = w, height = 0.5*h)
p1 <- plot(Lt[[1]])
show(p1)
dev.off()
png("meda_plots_tight/cumulativeVariance.png", width = w, height = h)
p1 <- plot(Lt[[3]])
show(p1)
dev.off()
png("meda_plots_tight/outliers.png", width = w, height = h)
p1 <- plot(Lt[[4]])
show(p1)
dev.off()
png("meda_plots_tight/cor.png", width = w, height = h)
plot(Lt[[6]])
dev.off()
png("meda_plots_tight/pairhexTight.png", width = 2*w, height = 2*h)
pairhex(stight)
dev.off()
png("meda_plots_tight/hmcClassificationsTight.png", width = 2*w, height = 2*h)
cr <- viridis(max(Lt[[7]]$dat$labels$col))
pairs(Lt[[7]]$dat$data, pch = 19, cex = 0.5, col = cr[Lt[[7]]$dat$labels$col])
dev.off()
png("meda_plots_tight/dendrograms.png", width = w, height = h)
plotDend(Lt[[7]])
dev.off()
png("meda_plots_tight/stackMeans.png", width = w, height = 2*h)
p1 <- stackM(Lt[[7]], ccol = ccol, depth = 3, centered = TRUE)
show(p1)
dev.off()
png("meda_plots_tight/clusterMeans.png", width = w, height = h)
p1 <- clusterMeans(Lt[[7]], ccol = ccol)
show(p1)
dev.off()
loc <- h5read(f, name = "Locations")
c1 <- closestK(Lt[[7]], K = 1, locs = loc)
c5 <- closestK(Lt[[7]], K = 5, locs = loc)
C1 <- Reduce(rbind, c1)
C5 <- Reduce(rbind, c5)
rownames(C1) <- NULL
rownames(C5) <- NULL
C1
#C5
f <- 'collman14v2_annotationCubes.csv.h5'
F0 <- h5read(f, name = "F0")
loc <- h5read(f, name = "Locations")
chan <- h5read(f, name = "Channels")
colnames(F0) <- chan
sF0 <- scale(F0, center = TRUE, scale = TRUE)
ccol <- c('blue', 'blue', 'blue', 'red', 'red',
'red', 'red', 'darkgreen', 'darkgreen', 'darkgreen',
'darkgreen')
set.seed(317)
Lc <- runAll(sF0, ccol = ccol)
Lc[[1]] <- mlocation(F0, ccol = ccol)
w = 720
h = 720
png("meda_plots_cubes/d1heat.png", width = w, height = h)
p1 <- plot(Lc[[2]])
show(p1)
dev.off()
png("meda_plots_cubes/mlocation.png", width = w, height = 0.5*h)
p1 <- plot(Lc[[1]])
show(p1)
dev.off()
png("meda_plots_cubes/cumulativeVariance.png", width = w, height = h)
p1 <- plot(Lc[[3]])
show(p1)
dev.off()
png("meda_plots_cubes/outliers.png", width = w, height = h)
p1 <- plot(Lc[[4]])
show(p1)
dev.off()
png("meda_plots_cubes/cor.png", width = w, height = h)
plot(Lc[[6]])
dev.off()
png("meda_plots_cubes/pairhex.png", width = 2*w, height = 2*h)
pairhex(sF0)
dev.off()
png("meda_plots_cubes/hmcClassifications.png", width = 2*w, height = 2*h)
cr <- viridis(max(Lc[[7]]$dat$labels$col))
pairs(Lc[[7]]$dat$data, pch = 19, cex = 0.5, col = cr[Lc[[7]]$dat$labels$col])
dev.off()
png("meda_plots_cubes/dendrograms.png", width = w, height = h)
plotDend(Lc[[7]])
dev.off()
png("meda_plots_cubes/stackMeans.png", width = w, height = 2*h)
p1 <- stackM(Lc[[7]], ccol = ccol, depth = 3, centered = TRUE)
show(p1)
dev.off()
png("meda_plots_cubes/clusterMeans.png", width = w, height = h)
p1 <- clusterMeans(Lc[[7]], ccol = ccol)
show(p1)
dev.off()